<%@page import="nnweboa.Unitls"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<%
	request.setCharacterEncoding("utf-8");
	String mail = request.getParameter("worknike").trim().toLowerCase();
	String workname = request.getParameter("workname").trim();

	if (Unitls.testMail(mail) && !workname.isEmpty()) {

		String password = Unitls.trytoSendtoMail(mail);
		String userright = request.getParameter("rightselect");
		Unitls.Saveuser(mail, password, userright, workname);
		request.getRequestDispatcher("humnmnager.jsp").forward(request,
				response);
	} else {
		request.getRequestDispatcher("adduser.jsp").forward(request,
				response);
	}
%>
</html>